Memory copying is a procedure in which data from a source portion of memory storage is duplicated and placed in a destination portion within memory storage. The location of the source portion is identified by a source address and the destination portion is identified by a destination address. This procedure can be time consuming because it duplicates the data from the source portion and it aligns the duplicated data in the destination portion according to the destination address. The procedure aligns the bytes of data on a word boundary in the destination portion so that the duplicated data in the destination portion minors the alignment of the data bytes in the source portion.
A byte-by-byte copy operation can be used to ensure the proper alignment of the duplicated data in the destination portion. In a byte-by-byte copy operation, a byte of data is duplicated from the source portion at a source address and is placed within the destination portion so that the duplicated byte is aligned within the destination portion as the byte appears in the source portion. While a byte-by-byte copy operation can ensure proper alignment of the duplicated data within the destination portion, a byte-by-byte copy operation is disfavored because it is time consuming in comparison to copying multiple bytes at a time. When copying multiple bytes at a time, the alignment of the duplicated data on a word boundary is important as data corruption can occur if the data within the destination portion is not aligned to mirror the alignment within the source portion.
In order to speed up data duplication over a byte-by-byte copy operation, one of several memory copies can be used to perform the multiple byte memory copy based on the alignment of bytes on a word boundary for the source portion and the destination portion. While copying multiple bytes at a time reduces the overall time spent for a memory copy procedure, this time reduction can be off-set by the time and resources spent determining which individual memory copy is to be used. This resource burden or overhead and the associated delay is troublesome due to the frequent occurrence of memory copy procedures.